﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Luxury_car_sales_system
{
    public partial class Goods_maintain2 : Form
    {
        public Goods_maintain2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string sql = string.Format("update Goods set CarID='{0}',GoodsName='{1}',Color='{2}',Price='{3}',SellPrice='{4}',MinStock='{5}',MaxStock='{6}',StartStock='{7}',Present='{8}' where GoodsID = '{9}'",textBox2.Text,textBox3.Text,textBox4.Text,textBox5.Text,textBox6.Text,textBox7.Text,textBox8.Text,textBox9.Text,richTextBox1.Text,textBox1.Text);
            bool a = DBHelper.ExcuteNonQuery(sql);
            if (a == true)
            {
                MessageBox.Show("修改成功！");
                string sql1 = "select * from Customer";
                DBHelper.ExcuteNonQuery(sql1);
            }
            else if (a == false)
            {
                MessageBox.Show("修改失败");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
